package cn.hx.controller.system;

import cn.hx.service.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

@Controller
public class IndexController {
    @Resource
    private UserReportService reportService;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private DeptService deptService;
    @Resource
    private UserEvaluationService userEvaluationService;
    @Resource
    ItemGroupService itemGroupService;
    @Resource
    NewsService newsService;
    @GetMapping("system/index")
    public String systemIndex(ModelMap map){
        map.addAttribute("itemStatus",reportService.selectCountByStatus());
        map.addAttribute("userCount",userInfoService.selectCount());
        map.addAttribute("deptCount",deptService.selectCount());
        map.addAttribute("evaluationCount",userEvaluationService.selectCount());
        map.addAttribute("itemGroupCount",itemGroupService.selectCount());
        map.addAttribute("newsCount",newsService.selectCount());
        return "system/index";
    }
}
